package com.xuetao.demo.cartoonface.util;

import java.io.IOException;

public class CartoonityUtil {

    public static void processPicture(String... filePaths) {
        Cartoonify cartoon = new Cartoonify();
        int arg = cartoon.setFlags(filePaths, 0);
        long time = 0;
        int done = 0;
        for (; arg < filePaths.length; arg++) {
            try {
                time += cartoon.processPhoto(filePaths[arg]);
            } catch (IOException e) {
                e.printStackTrace();
            }
            done++;
        }
        System.out.format("Average processing time is %.3f for %d photos.", time / done / 1e3, done);
    }
}
